<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件


/**
 * @param $draw DataTables 每次发送请求会带上这个参数，接收到以后转成 int 类型返回去就行
 * @param $data 数据填充
 * @param $recordsTotal 总记录数（未过滤）
 * @param $recordsFiltered 记录数（已过滤/检索）
 * @return false|string
 */
function dtRequest($draw,$data,$recordsTotal,$recordsFiltered){
    $res=[];
    $res['draw']=$draw;
    $res['data']=$data;
    $res['recordsTotal']=$recordsTotal;
    $res['recordsFiltered']=$recordsFiltered;
    $res['error']='';
    echo json_encode($res,JSON_UNESCAPED_UNICODE);
}